package lk.icta.common;

import lk.icta.UnitTestContext;
import org.apache.struts2.StrutsSpringTestCase;
import org.springframework.web.context.WebApplicationContext;

/**
 * @author Mahesha Kalpanie
 */
public abstract class BaseStrutsSpringTestCase extends StrutsSpringTestCase {

    public BaseStrutsSpringTestCase() {
        applicationContext = UnitTestContext.getInstance().getApplicationContext();
    }

    @Override
    protected void setupBeforeInitDispatcher() throws Exception {
        servletContext.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, applicationContext);
    }
}
